package test.v2;

import com.baishui.context.ApplicationContext;
import com.baishui.context.support.ClassPathXmlApplicationContext;
import com.baishui.service.BaishuiV2Service;
import com.baishui.service.entity.Car;
import org.junit.Test;
import static org.junit.Assert.*;

public class Step03_ApplicationContextTestV2 {

	@Test
	public void testGetBeanProperty() {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("litespring-v2.xml");
		BaishuiV2Service baishuiService = (BaishuiV2Service)ctx.getBean("baishuiV2Service");
		
		assertNotNull(baishuiService.getCar());

		assertTrue(baishuiService.getCar() instanceof Car);

		assertEquals("baishui",baishuiService.getName());
		assertEquals(2, baishuiService.getAge());
	}

}
